package com.nmc.core.manager;

import java.util.List;

import com.nmc.core.dao.EmployeeDAO;
import com.nmc.core.dao.TrackDAO;
import com.nmc.model.Employee;
import com.nmc.model.Track;

public class TrackManagerImpl implements TrackManager {
	
	private TrackDAO trackDao = null;
	private EmployeeDAO employeeDao = null;
		
	public EmployeeDAO getEmployeeDao() {
		return employeeDao;
	}

	public void setEmployeeDao(EmployeeDAO employeeDao) {
		this.employeeDao = employeeDao;
	}

	private static final long serialVersionUID = 1L;

	public void createTrack(Track track) {
		//Employee swp = getEmployeeDao().getEmployeeById(track.getSweeperId());

		//if(swp != null ) {
		//	track.setSweeperName(swp.getEmpName() + " " + swp.getEmpSurname());
		//}
		//if(track.getSuperviserId() !=null && !track.getSuperviserId().equals("")) {	
		//	Employee supervisor = getEmployeeDao().getEmployeeById(track.getSuperviserId());
		//	if(supervisor != null) {
		//		track.setSuperviserName(supervisor.getEmpName() + " " + supervisor.getEmpSurname());
		//	}
		//}
		
		getTrackDao().createTrack(track);
	}

	public void updateTrack(Track track) {
		getTrackDao().updateTrack(track);
	}

	public void deleteTrack(Track track) {
		getTrackDao().deleteTrack(track);
	}

	public List getTrackList() {
		return getTrackDao().getTrackList();
	}

	public Track getTrack(int trackId) {
		return getTrackDao().getTrack(trackId);
	}

	/**
	 * @param trackDao the trackDao to set
	 */
	public void setTrackDao(TrackDAO trackDao) {
		this.trackDao = trackDao;
	}

	/**
	 * @return the trackDao
	 */
	public TrackDAO getTrackDao() {
		return trackDao;
	}

	public List filterTrack(Track track) {
		return trackDao.filterTrack(track);
	}

	public List getWardTrackList(int wardId) {
		return trackDao.getWardTrackList(wardId);
	}

	public List getWardTrackListByEmp(int id) {
		// TODO Auto-generated method stub
		return trackDao.getWardTrackListByEmp(id);
	}
	
	
}
